package com.hznu.stmanage.serviceImpl;

import com.hznu.stmanage.dao.PracticeInfoMapper;
import com.hznu.stmanage.entity.PracticeInfo;
import com.hznu.stmanage.service.BaseService;
import com.hznu.stmanage.service.PracticeInfoService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by J_Vino on 16/3/6.
 */
@Transactional(rollbackFor = Exception.class)
@Service
public class PracticeInfoServiceImpl extends BaseService implements PracticeInfoService {

    PracticeInfoMapper practiceInfoMapper = null;
    public void setMapper()
    {
        if(practiceInfoMapper==null)
            practiceInfoMapper = getPracticeInfoMapper();//1.获取相关mapper
    }
    public int deleteByPrimaryKey(Long id) {
        setMapper();
        return practiceInfoMapper.deleteByPrimaryKey(id);
    }

    public int insert(PracticeInfo record) {
        setMapper();
        return practiceInfoMapper.insert(record);
    }

    public int insertSelective(PracticeInfo record) {
        setMapper();
        return practiceInfoMapper.insertSelective(record);
    }

    public PracticeInfo selectByPrimaryKey(Long id) {
        setMapper();
        return practiceInfoMapper.selectByPrimaryKey(id);
    }

    public int updateByPrimaryKeySelective(PracticeInfo record) {
        setMapper();
        return practiceInfoMapper.updateByPrimaryKeySelective(record);
    }

    public int updateByPrimaryKey(PracticeInfo record) {
        setMapper();
        return practiceInfoMapper.updateByPrimaryKey(record);
    }
}
